package com.yohann.designPattern.state;

/**
 * <p>
 * 不能抽奖
 * </p>
 *
 * @author Yohann
 * @since 2021/2/13 17:16
 */
public class NoRaffle implements State {
    private RaffleActivity activity;

    public NoRaffle(RaffleActivity activity) {
        this.activity = activity;
    }

    @Override
    public void deductMoney() {
        System.out.println("扣除50积分，可以抽奖了");
        activity.setState(activity.getCanRaffle());
    }

    @Override
    public boolean raffle() {
        System.out.println("请先扣除积分");
        return false;
    }

    @Override
    public void dispensePrize() {
        System.out.println("不能发放奖品");
    }
}